from selenium.webdriver.common.by import By
from data002.Base.Base import Base

class Page(Base):
    # 点击登录按钮:
    login01 = (By.XPATH,'//*[@id="s-top-loginbtn"]')
    def login_01(self):
        self.click(self.login01)
    # 输入账号:  userName
    userName = (By.NAME,'userName')
    def userName01(self):
        self.send_keys(self.userName,'17518836160')
    # 输入密码
    password = (By.XPATH,'//input[@name="password" or @id="TANGRAM__PSP_32__password"]')
    def password01(self):
        self.send_keys(self.password,'17518836160ge')
    # 勾选协议
    isAgree = (By.ID,'TANGRAM__PSP_32__isAgree')
    def isAgree01(self):
        self.click(self.isAgree)
    # 点击登录
    submit = (By.ID,'TANGRAM__PSP_32__submit')
    def submit01(self):
        self.click(self.submit)


    def text_casr_baidu(self):
        # 添加强制等待以便观察效果
        self.url_open('https://www.baidu.com/')
        self.sellp(5)
        self.login_01()
        self.sellp(2)
        self.userName01()
        self.sellp(2)
        self.password01()
        self.sellp(2)
        self.isAgree01()
        self.sellp(2)
        self.submit01()
        self.sellp(5)

